
<style type="text/css">
    .type_text,.type_img{display: none}
</style>
<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <div class="panel-lead" style="line-height: 22px;">
            <em>{:__('Warning')}</em>
            系统支持添加图片及文字水印。<br/>
            字体文件后缀为.ttf，图片透明度100为不透明。
        </div>
        <ul class="nav nav-tabs">
            <li class="active"><a href="#edit" data-toggle="tab">图片水印配置</a></li>
        </ul>
    </div>

    <div class="panel-body" style="padding-bottom: 0;">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane active" id="edit">
                <div class="widget-body no-padding">
                    <form id="edit-form" class="edit-form form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                        {:token()}
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th width="15%">{:__('Title')}</th>
                                <th width="85%">{:__('Value')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td>{:__('Type')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="radio">
                                                {foreach name="typeList" item="vo"}
                                                <label for="row[type]-{$key}" style="width: 10%;">
                                                    <input id="row[type]-{$key}" {in name="key" value="$row.type"}class="type" checked="checked"{/in} name="row[type]" type="radio" value="{$key}"> {$vo}
                                                </label>
                                                {/foreach}
                                            </div>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>{:__('Location')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="radio">
                                                {php}$i = 0;{/php}
                                                {foreach name="locationList" item="vo"}
                                                <label for="row[location]-{$key}" style="width: 10%;">
                                                    <input id="row[location]-{$key}" {in name="key" value="$row.location"}checked="checked" class="location" {/in} name="row[location]" type="radio" value="{$key}"> {$vo}
                                                </label>
                                                {php}$i++;{/php}
                                                {if $i % 3 == 0}<br/>{/if}
                                                {/foreach}
                                            </div>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_img">
                                <td>{:__('Image')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="input-group">
                                                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                                                <div class="input-group-addon no-border no-padding">
                                                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg,image/bmp" data-url="watermark/upload" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                                </div>
                                                <span class="msg-box n-right" for="c-image"></span>
                                            </div>
                                            <ul class="row list-inline plupload-preview" id="p-image"></ul>
                                        </div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_img">
                                <td>{:__('Transparency')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-transparency" data-rule="required" aria-invalid="true" class="form-control" name="row[transparency]" type="number" value="{$row.transparency|htmlentities}">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_text">
                                <td>{:__('Text_content')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-text_content" data-rule="required" class="form-control" name="row[text_content]" type="text" value="{$row.text_content|htmlentities}">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_text">
                                <td>{:__('Text_font')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="input-group">
                                                <input id="c-text_font" data-rule="required" class="form-control" size="50" name="row[text_font]" type="text" value="{$row.text_font|htmlentities}">
                                                <div class="input-group-addon no-border no-padding">
                                                    <span><button type="button" id="plupload-file" data-maxsize="20480000" class="btn btn-danger plupload" data-input-id="c-text_font" data-mimetype="ttf" data-multiple="false" data-preview-id="p-text_font" data-url="watermark/upload"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                                </div>
                                                <span class="msg-box n-right" for="c-text_font"></span>
                                            </div>
                                            <ul class="row list-inline plupload-preview" id="p-text_font"></ul>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_text">
                                <td>{:__('Text_color')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-text_color" data-rule="required" class="form-control" name="row[text_color]" type="text" value="{$row.text_color|htmlentities}" style="width: 20%">
                                            <span class="input-group-btn" style="display: unset;">
                                            <button type="button" class="btn btn-default btn-color colorpicker" style="padding:0;margin-left:1px;" title="选择颜色"><img src="__CDN__/assets/addons/watermark/img/colorful.png" height="29" alt=""></button>
                                            <span class="msg-box n-right" for="c-text_color"></span>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_text">
                                <td>{:__('Text_size')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-text_size" data-rule="required" aria-invalid="true" class="form-control" name="row[text_size]" type="number" value="{$row.text_size|htmlentities}">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr class="type_text">
                                <td>{:__('Text_angle')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-text_angle" data-rule="required" aria-invalid="true" class="form-control" name="row[text_angle]" type="number" value="{$row.text_angle|htmlentities}">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>{:__('Text_offset')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <input id="c-text_offset" data-rule="required" aria-invalid="true" class="form-control" name="row[text_offset]" type="number" value="{$row.text_offset|htmlentities}">
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td>{:__('Status')}</td>
                                <td>
                                    <div class="row">
                                        <div class="col-sm-8 col-xs-12">
                                            <div class="radio">
                                                {foreach name="statusList" item="vo"}
                                                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
                                                {/foreach}
                                            </div>
                                        </div>
                                        <div class="col-sm-4"></div>
                                    </div>
                                </td>
                            </tr>


                            </tbody>
                            <tfoot>
                            <tr>
                                <td></td>
                                <td>
                                    <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
                                    <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                            </tfoot>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
